const {app, BrowserWindow} = require('electron');

import {getMainWindow} from "./app/browser-windows/MainWindow"
import {setApplicationMenu} from "./app/ApplicationMenu"
import {createTray} from "./app/ApplicationTray"

if (require('electron-squirrel-startup')) {
    app.quit();
}

let mainWindow

app.whenReady()
    .then(() => {
        mainWindow = getMainWindow();
    })
    .then(() => {
        //setApplicationMenu()
    })
    .then(() => {
        createTray()
    })

app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') {
        app.quit();
    }
});

app.on('activate', () => {
    // On OS X it's common to re-create a window in the app when the
    // dock icon is clicked and there are no other windows open.
    if (BrowserWindow.getAllWindows().length === 0) {
        getMainWindow()
    }
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and import them here.
